{$layout "layout_popup"}

<h3>证书详情</h3>
<table class="ui table definition selectable">
	<tr>
		<td class="title">证书说明</td>
		<td>{{info.name}}</td>
	</tr>
	<tr v-if="info.description.length > 0">
		<td>详细说明</td>
		<td>{{info.description}}</td>
	</tr>
	<tr>
		<td>证书状态</td>
		<td>
			<span class="ui label small green basic" v-if="info.isAvailable">有效中</span>
			<span class="ui label small red basic" v-else>已过期</span>
		</td>
	</tr>
	<tr>
		<td>发行信息</td>
		<td>
			<div v-if="info.commonNames != null">
				<div v-for="(commonName, index) in info.commonNames">
					<span v-html="indent(index)"></span>{{commonName}}
				</div>
			</div>
		</td>
	</tr>
	<tr>
		<td>域名</td>
		<td>
			<span class="ui label small basic" v-for="dnsName in info.dnsNames">{{dnsName}}</span>
		</td>
	</tr>
	<tr>
		<td>有效期</td>
		<td>{{info.beginTime}} - {{info.endTime}}</td>
	</tr>
	<tr>
		<td>引用网站</td>
		<td>
			<span class="disabled" v-if="servers.length == 0">暂时没有引用此证书的网站。</span>
			<div v-if="servers.length > 0">
				<a v-for="server in servers" :href="'/servers/server/settings/https?serverId=' + server.id" target="_blank" class="ui label small basic">{{server.name}}</a>
			</div>
		</td>
	</tr>
	<tr>
		<td>证书文件下载</td>
		<td>
			<a :href="'/servers/certs/downloadZip?certId=' + info.id" target="_blank">[ZIP下载]</a> &nbsp;
			<a :href="'/servers/certs/downloadCert?certId=' + info.id" target="_blank">[证书下载]</a> &nbsp;
			<a :href="'/servers/certs/downloadKey?certId=' + info.id" v-if="!info.isCA" target="_blank">[私钥下载]</a>
		</td>
	</tr>
	<tr>
		<td>证书预览</td>
		<td>
			<pre class="pre-box" style="font-family: Menlo, Monaco, 'Courier New', monospace !important">{{info.certString}}</pre>
			<div style="margin-top:1em">
				<a :href="'/servers/certs/viewCert?certId=' + info.id" target="_blank">[浏览器新窗口打开]</a>
			</div>
		</td>
	</tr>
	<tr v-if="!info.isCA">
		<td>私钥预览</td>
		<td><pre class="pre-box" style="font-family: Menlo, Monaco, 'Courier New', monospace !important">{{info.keyString}}</pre>
			<div style="margin-top: 1em">
				<a :href="'/servers/certs/viewKey?certId=' + info.id" target="_blank">[浏览器新窗口打开]</a>
			</div>
		</td>
	</tr>
</table>